/* $Id:misc.h jjs $ */
/*
   Copyright (C) 2007 by Jurjen Stellingwerff <jurjen@stwerff.xs4all.nl>
   Part of the Moros Project http://moros.sourceforge.net/

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License.
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY.

   See the COPYING file for more details.
*/
#ifndef __MISC_H
#define __MISC_H

#include <string>

/** \dir src/general
  * General functions for all the programs
  */

/// Calculate a sha1 hash value from a string. The result is a hexadecimal 40 tokens number.

std::string hash(
    std::string str ///< Base string from where the hash value is calculated
);

/// Find a derived hash from a session string that protects to real session string from observers.

std::string derived(
    std::string session,///< session string in need of protection
    int sessnr          ///< number that increases every communication session
);

#endif
